// 添加球体
// id：服务化平台给出的UUID，字符串
// name：球体名称
// point：球心位置，[经,纬,高]（[-114.0, 40.0, 300000.0]）
// size:球体半径，（[200000.0, 200000.0, 300000.0]）
// fillColor：球体填充颜色，数组：[R,G,B,255]（[255, 0, 0, 128]）
// isFilled：是否填充，true or false
// isOutline：是否显示轮廓，true or false
// outlineColor：轮廓颜色，数组：[R,G,B,255]（[255,0,0,255]）
import CZML_GENERALTOOLS_CLASS from "./../main/CZML_GENERALTOOLS_CLASS.js"
class CZML_Sphere {
    constructor(viewer, id, name, point, size, fillColor, isFilled, isOutline, outlineColor) {
        this._viewer = viewer
        this.id = id
        this.name = name
        this.point = point
        this.size = size
        this.fillColor = fillColor
        this.isFilled = isFilled
        this.isOutline = isOutline
        this.outlineColor = outlineColor
        this.Sphere = {

            id: id,
            name: name,
            position: {
                cartographicDegrees: point
            },
            ellipsoid: {
                radii: {
                    cartesian: size
                },
                fill: isFilled,
                outline: isOutline,
                outlineColor: {
                    rgba: outlineColor
                },
                material: {
                    solidColor: {
                        color: {
                            rgba: fillColor
                        }
                    }
                }
            }
        }
        this.CZML_AddSphere()
    }

    CZML_AddSphere() {
        // 插入该数据对象
        const ret = CZML_GENERALTOOLS_CLASS.InsertModelObjectInformation(this.id, this.Sphere, true)
        // 上图
        CZML_GENERALTOOLS_CLASS.Upper(this._viewer)
        return ret
    }
}
export default CZML_Sphere
